package game;

import engine.core.GameComponent;
import engine.core.Transform;
import engine.rendering.Material;
import engine.rendering.Mesh;
import engine.rendering.Shader;

public class MeshRenderer implements GameComponent {

    private Mesh mesh;
    private Material material;
    
    public MeshRenderer(Mesh mesh, Material material) {
        this.mesh = mesh;
        this.material = material;
    }

    @Override
    public void input(Transform transform, float delta) {
    }

    @Override
    public void update(Transform transform, float delta) {
    }
    
    @Override
    public void render(Transform transform, Shader shader) {
        shader.bind();
        shader.updateUniforms(transform, material);
        mesh.draw();
    }
    
}
